/**
 * cn.ucox.web.framework.rendors.pushmq.entity.AppMessage
 *
 * @author chenw
 * @create 16/3/3.16:29
 * @email javacspring@hotmail.com
 */

package com.oceansoft.mobile.econsole.modules.jlapi.entity;

import java.util.Map;

/**
 * 消息通道手机App极光推送消息类
 *
 * @author chenw
 * @create 16/3/3 16:29
 * @email javacspring@gmail.com
 */
public class AppMessage extends ApiMessage {



    /**
     * 消息类型
     */
    public enum MessageType {

        //应用消息
        APP_NEWS(-3),
        //升级信息
        APP_UPGRADE(-2),
        //系统通知
        SYS_NOTICE(-1),
        //办件处理过程
        CASE_PROCESS(1),
        //业务公示公告
        BIZ_NOTICE(2),
        //车轮绑定信息
        VEHICLE_BIND(3),
        //查询类服务
        QUERY_SERVICE(4),
        //消息订阅
        NEWS_SUB(5);

        private int value;

        MessageType(int value) {
            this.value = value;
        }

        public int value() {
            return value;
        }

        @Override
        public String toString() {
            return String.valueOf(this.value);
        }
    }

    /**
     * 消息源访问地址
     */
    private String url;
    /**
     * 通知标题
     */
    private String title;
    /**
     * 通知保留时间
     */
    private long ttl = 86400;
    /**
     * 消息角标(iOS平台专用)
     */
    private int badge = 1;
    /**
     * 通知内容
     */
    private String content;
    /**
     * 通知接收人
     */
    private String[] receiver;
    /**
     * 通知类型
     */
    private MessageType msgType;
    /**
     * 扩展消息
     */
    private Map<String, String> extra;
    /**
     * 堵路车辆号牌号码
     */
    private String hphm;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public long getTtl() {
        return ttl;
    }

    public void setTtl(long ttl) {
        this.ttl = ttl;
    }

    public int getBadge() {
        return badge;
    }

    public void setBadge(int badge) {
        this.badge = badge;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String[] getReceiver() {
        return receiver;
    }

    public void setReceiver(String... receiver) {
        this.receiver = receiver;
    }

    public MessageType getMsgType() {
        return msgType;
    }

    public void setMsgType(MessageType msgType) {
        this.msgType = msgType;
    }

    public Map<String, String> getExtra() {
        return extra;
    }

    public void setExtra(Map<String, String> extra) {
        this.extra = extra;
    }

    public AppMessage() {
        super(PushChannel.APP);
    }

    public String getHphm() {
        return hphm;
    }

    public void setHphm(String hphm) {
        this.hphm = hphm;
    }
}
